<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/style.css">
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>
    <title>订单管理</title>
    <script>
        $(function(){
            $(".last").click(
                    function(){
                        $(".list").toggle();
                    }
            )
        })
    </script>
</head>
<body>
<div class="wrap-man">
    <div class="header">
        <p>订单管理</p>
        <img src="__STATIC__/img/back.png" class="back" onclick =window.location.href="{:url('mobile/shop_auth/member_shop')}";>
        <img src="__STATIC__/img/search.png" class="search" onclick =window.location.href="{:url('mobile/shop_auth/order_query')}";>
    </div>
    <div class="center">
        <div class="tablist" style="margin-bottom: 0.5%;">
            <ul>
                <li {if condition="input('type') eq -1" }class="cur"{/if}><a href="javascript:jump(-1);">全部({$statistics[0]})</a></li>
                <li {if condition="input('type') eq 0 " }class="cur"{/if}><a href="javascript:jump(0);">待付款({$statistics[1]})</a></li>
                <li {if condition="input('type') eq 1 " }class="cur"{/if}><a href="javascript:jump(1);">待收货({$statistics[2]})</a></li>
                <li {if condition="input('type') eq 6 " }class="cur"{/if}><a href="javascript:jump(6);">退款中({$statistics[3]})</a></li>
            </ul>
            <div class="last">
                <div>
                    <a href="javascript:;"><span>更多 </span><img src="__STATIC__/img/down1.png"></a>
                    <ul class="list">
                        <li {if condition="input('type') eq 3 " }class="cur"{/if}><a href="javascript:jump(3);">待评价({$statistics[4]})</a></li>
                        <li {if condition="input('type') eq 2 " }class="cur"{/if}><a href="javascript:jump(2);">已发货({$statistics[5]})</a></li>
                        <li {if condition="input('type') eq 4 " }class="cur"{/if}><a href="javascript:jump(4);">已完成({$statistics[6]})</a></li>
                        <li {if condition="input('type') eq 5 " }class="cur"{/if}><a href="javascript:jump(5);">已关闭({$statistics[7]})</a></li>
                    </ul>
                    <input type="hidden" id="type" value="{:input('type','-1')}" />
                    <input type="hidden" id="search" value="{:input('search','')}" />
                    <input type="hidden" id="search_type" value="{:input('search_type',1)}" />
                </div>
            </div>
        </div>
        <div class="tabcon">
            <div class="cur">
                {volist name='res' id='v' key='k'}
                <div>
                    <div class="time">
                        <h4>下单时间：{$v[0]['create_time']}</h4>
                        <p>{$v[0]->status_text}</p>
                    </div>
                    <div class="main">
                        {volist name='v' id='vv'}
                        {if condition="$vv.memberOrderAttached"}
                        {volist name='$vv.memberOrderAttached' id='item'}
                        <div class="content">
                            <div class="left">
                                <img src="/{$item.thumb_img}">
                            </div>
                            <div class="right">
                                <h4>{$item.title}</h4>
                                <p class="color">商品规格：{$item.attr}</p>
                                <p class="price">&yen;{$item.price}<span>×{$item.number}</span></p>
                            </div>
                        </div>
                        {/volist}
                        {/if}
                        {/volist}
                        <p class="total">共{$opt[$k-1]}件商品    实付:<span>&yen;{$vv.price}</span></p>
                        <input type="hidden" value="{$v[0]['shop_order_number']}" id="order_number" />
                        <div class="order"><span><a href="javascript:act({$v[0]['status']});">{$v[0]->act_text}</a></span></div>
                    </div>
                </div>
                {/volist}
            </div>
        </div>
    </div>
{include file="public/src" /}
</div>
<script>
    //页面跳转
    function jump(type){
        var search_type = $('#search_type').val();
        var search = $('#search').val();
        window.location.href="?type="+type+"&search="+search+"&search_type="+search_type;
    }
    //处理订单
    function act(type){
        var jump_type = $('#type').val();
        //店铺订单编号
        var order_number = $('#order_number').val();
        if (type == 6){  //退款
            window.location.href = "{:url('mobile/shop_auth/refund')}?id="+order_number+"&type="+jump_type;
        }else{
            window.location.href = "{:url('mobile/shop_auth/order_details')}?id="+order_number+"&type="+jump_type;
        }
    }
</script>
</body>
</html>